require "luajit-stdlib.__tableUtil"
---@class stringlib
string = table.extend(string);
---拆分文本
---@param str string 被拆分的文本
---@param delimiter string 拆分的文本
function string.split(str, delimiter)
    for i = 1, #str, 1 do
        print(str:sub(i, i))
    end
    -- local dLen = string.len(delimiter)
    -- local newDeli = ""
    -- for i = 1, dLen, 1 do
    --     newDeli = newDeli .. "[" .. string.sub(delimiter, i, i) .. "]"
    -- end

    -- local locaStart, locaEnd = string.find(str, newDeli)
    -- local arr = {}
    -- local n = 1
    -- while locaStart ~= nil do
    --     if locaStart > 0 then
    --         arr[n] = string.sub(str, 1, locaStart - 1)
    --         n = n + 1
    --     end

    --     str = string.sub(str, locaEnd + 1, string.len(str))
    --     locaStart, locaEnd = string.find(str, newDeli)
    -- end
    -- if str ~= nil then
    --     arr[n] = str
    -- end
    -- return arr
end
